//
//  UserTradingCell.m
//  CheekiOS
//
//  Created by mac on 2017/6/21.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "UserTradingCell.h"

@interface UserTradingCell ()

@property (nonatomic, strong) UILabel *nameLab;
@property (nonatomic, strong) UILabel *giftLab;
@property (nonatomic, strong) UILabel *timeLab;
@property (nonatomic, strong) UILabel *linLab;

@end

@implementation UserTradingCell

+ (instancetype)cellWithTableView:(UITableView *)tableView indexPath:(NSIndexPath*)indexPath {
    
    static NSString *UserTradingCellIdent = @"UserTradingCellIdent";
    
    UserTradingCell *cell = [tableView dequeueReusableCellWithIdentifier:UserTradingCellIdent];
    
    if (!cell) {
        cell = [[UserTradingCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:UserTradingCellIdent];
    }
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.nameLab = [[UILabel alloc] init];
        self.nameLab.font = FontP(15);
        self.nameLab.textAlignment = NSTextAlignmentLeft;
        self.nameLab.textColor = ColorI(0x5978b6);
        [self addSubview:self.nameLab];
        
        self.giftLab = [[UILabel alloc] init];
        self.giftLab.font = FontP(12);
        self.giftLab.textAlignment = NSTextAlignmentLeft;
        self.giftLab.textColor = [UIColor blackColor];
        [self addSubview:self.giftLab];
        
        self.timeLab = [[UILabel alloc] init];
        self.timeLab.font = FontP(12);
        self.timeLab.textAlignment = NSTextAlignmentLeft;
        self.timeLab.textColor = RGB(220, 220, 220);
        [self addSubview:self.timeLab];

        
        self.linLab  = [[UILabel alloc] init];
        self.linLab.backgroundColor = TheLinColor;
        [self addSubview:self.linLab];

    }
    return self;
}


-(void)setModel:(UserCharmDetailListModel *)model{
    
//    note	描述	支付宝充值  支付宝提现  微信充值  礼物赠送  礼物领取  礼物退回
    
    self.nameLab.text = model.remark;
    self.giftLab.text = model.content;
    self.timeLab.text = model.createTime;

    
    
    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.top.equalTo(self);
        make.height.mas_equalTo(30);
    }];

    
    [self.giftLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLab.mas_right).offset(15);
        make.top.equalTo(self);
        make.height.mas_equalTo(30);
    }];

    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.top.equalTo(self.nameLab.mas_bottom);
        make.height.mas_equalTo(30);
    }];
    
  
    
    [self.linLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.timeLab.mas_bottom).offset(3);
        make.right.width.equalTo(self);
        make.height.mas_equalTo(1);
    }];

}





@end
